#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>

#define MAX_SIZE 1000

using namespace std;

int main() {
	char a[MAX_SIZE], b[MAX_SIZE];
	char temp[MAX_SIZE];
	scanf("%s", a);
	scanf("%s", b);

	// add
	int i = strlen(a)-1;
	int j = strlen(b)-1;
	int carry = 0;
	int count = 0;
	char result[MAX_SIZE];

	while (i >= 0 && j >= 0) {
		int x = a[i]-'0', y = b[j]-'0';
		result[count++] = (x+y+carry) % 10+'0';
		if ((x+y+carry) >= 10) {
			carry = 1;
		} else {
			carry = 0;
		}
		--i;
		--j;
	}
	while (i >= 0) {
		int x = a[i]-'0';
		result[count++] = (x+carry) % 10+'0';
		if ((x+carry) >= 10) {
			carry = 1;
		} else {
			carry = 0;
		}
		--i;
	}
	while (j >= 0) {
		int y = b[j]-'0';
		result[count++] = (y+carry) % 10+'0';
		if ((y+carry) >= 10) {
			carry = 1;
		} else {
			carry = 0;
		}
		--j;
	}
	if (carry == 1) {
		result[count++] = '1';
		carry = 0;
	}
	for (int x = count-1; x >= 0; --x)
		printf("%c", result[x]);
	printf("\n");

	// minus
	bool negative = false;
	char minus_result[MAX_SIZE];
	int minus_count = 0;
	i = strlen(a)-1;
	j = strlen(b)-1;
	if (i < j) {
		strcpy(temp, a);
		strcpy(a, b);
		strcpy(b, temp);
		negative = true;
	} else if (i == j) {
		int p = 0;
		while (p <= i) {
			if (a[p] < b[p]) {
				strcpy(temp, a);
				strcpy(a, b);
				strcpy(b, temp);
				negative = true;
				break;
			} else if (a[p] > b[p]) {
				break;
			}
			++p;
		}
	}
	i = strlen(a)-1;
	j = strlen(b)-1;
	while (i >= 0 && j >= 0) {
		int x = a[i]-'0', y = b[j]-'0';
		if (x - y - carry < 0) {
			minus_result[minus_count++] = (10 + x - y - carry) + '0';
			carry = 1;
		} else {
			minus_result[minus_count++] = (x - y - carry) + '0';
			carry = 0;
		}
		--i;
		--j;
	}
	while (i >= 0) {
		int x = a[i]-'0';
		if ((x-carry) < 0) {
			minus_result[minus_count++] = (10+x-carry)+'0';
			carry = 1;
		} else {
			minus_result[minus_count++] = (x-carry) % 10+'0';
			carry = 0;
		}
		--i;
	}
	while (j >= 0) {
		int y = b[j]-'0';
		if ((y-carry) < 0) {
			minus_result[minus_count++] = (10+y-carry) % 10+'0';
			carry = 1;
		} else {
			minus_result[minus_count++] = (y-carry) % 10+'0';
			carry = 0;
		}
		--j;
	}
	bool start = true;
	if (negative) printf("-");
	for (int x = minus_count-1; x >= 0; --x) {
		if (start && minus_result[x] == '0')
			continue;
		printf("%c", minus_result[x]);
		start = false;
	}
	printf("\n");

	// multiply
    int la,lb;
    char c[MAX_SIZE];
    la = strlen(a);
    lb = strlen(b);
    for(int i = 0; i < la+lb; i++){
        c[i] = '0';
    }
    carry = 0;
    int v;
    reverse(a, a+la);
    reverse(b, b+lb);
    for(int i = 0; i < la; i++) {
        for(int j = 0;j < lb; j++) {
            v = carry + (a[i]-'0') * (b[j]-'0') + (c[i+j]-'0');
            c[i+j] = '0' + v % 10;
            carry = v / 10;
            if(j == lb-1){
                c[i+j+1] = '0' + carry;
                carry = 0;
            }
        }
    }
    reverse(c, c+la+lb);

    start = true;
    for (int n = 0; n < la+lb; ++n) {
    	if (start && c[n] == '0')
    		continue;
    	printf("%c", c[n]);
    	start = false;
    }
    printf("\n");

	return 0;
}